﻿//-----------------------------------------------------------------------
// <copyright>
//     Copyright (c) Artur Mustafin. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Expressions.Compiler.Interfaces
{
    using System;

    /// <summary>
    /// Interface for the expression tree
    /// </summary>
    public interface IExpression
    {
        /// <summary>
        /// Name of the instance
        /// </summary>
        string Name { get; }
        /// <summary>
        /// Sets the function used in construction of the tree nodes
        /// </summary>
        /// <value>The eval.</value>
        Func<IExpressionTreeNode, IExpressionTree, IExpressionTreeNode> Eval { set; }
        /// <summary>
        /// Gets the <see cref="Expressions.Compiler.IExpressionBase"/> with the specified expression value and tree node.
        /// </summary>
        /// <value></value>
        IExpressionTreeNode this[IExpressionTreeNode value, IExpressionTree tree] { get; }
        /// <summary>
        /// Gets the <see cref="Expressions.Compiler.IExpressionBase"/> with the specified tree node.
        /// </summary>
        /// <value></value>
        IExpressionTreeNode this[IExpressionTree tree] { get; }
    }
}
